﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Internal.Master" Inherits="BPM.Web.ViewPage" %>

<asp:Content ID="c1" ContentPlaceHolderID="TitleContent" runat="server">
	用户列表
</asp:Content>
<asp:Content ID="c3" ContentPlaceHolderID="ScriptStyleContent" runat="server">
</asp:Content>
<asp:Content ID="c2" ContentPlaceHolderID="MainContent" runat="server">
	<%
		var users = this.ViewData["Users"] as PagedList<BPM.Entity.User>;
	%>
	<table class="altTable">
		<thead>
			<tr>
				<td>
					用户名
				</td>
				<td>
					真实姓名
				</td>
				<td>
					角色
				</td>
				<td>
					审核状态
				</td>
				<td>
				</td>
				<%--<td>
				</td>--%>
			</tr>
		</thead>
		<tbody>
			<% 
				foreach (var user in users)
				{
			%>
			<tr>
				<td>
					<%= user.UserName%>
				</td>
				<td>
					<%= user.RealName%>
				</td>
				<td>
					<% 
						int i = 0;
						foreach (var role in user.RoleList)
						{ 
					%>
					<%= i == 0? string.Empty :","  %>
					<%= role.Name%>
					<%
} 
					%>
				</td>
				<td>
					<%
						if (user.IsValid)
						{
					%>
					审核通过
					<%
						}
					else
					{
					%>
					审核未通过，您可以： <a href="javascript:;" onclick="permitUser(<%=user.Id %>);">审核通过</a>
					<%
						}
					%>
				</td>
				<td>
					<%= Html.ActionLink("修改角色", AD.Singleton.Authority.AssignAuthority, new { userId = user.Id })%>
				</td>
				<%--<td>
					<a href="javascript:;" onclick="deleteUser(<%=user.Id %>);">删除</a>
				</td>--%>
			</tr>
			<%
				}
			%>
		</tbody>
	</table>
	<%=Html.NewPager(users)%>
</asp:Content>
